package cn.wsw.hrm.client;

import cn.wsw.hrm.util.AjaxResult;
import feign.Response;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

@Component
public class FastdfsClientFallbackFactory implements FallbackFactory<FastdfsClient> {
    @Override
    public FastdfsClient create(Throwable throwable) {
        return new FastdfsClient() {
            @Override
            public AjaxResult upload(MultipartFile file) {
                return new AjaxResult().setSuccess(false).setMessage("上传失败");
            }

            @Override
            public Response download(String filePath) {
                return null;
            }
        };
    }
}
